package com.diandian.backend.member.controller;

import com.diandian.backend.member.dto.DouyinLifeMemberInfoChangeAddParamDTO;
import com.diandian.backend.member.param.*;
import com.diandian.backend.member.service.DouyinLifeMemberInfoChangeRecordService;
import com.diandian.base.boot.starter.response.BaseResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * 线上抖音会员信息变更记录表
 *
 * @author zyz diandian@qq.com
 * @since 1.0.0 2025-07-09
 */
@RestController
@RequestMapping("/douyin/life/member/info/change")
public class DouyinLifeMemberInfoChangeController {

    @Autowired
    private DouyinLifeMemberInfoChangeRecordService douyinLifeMemberInfoChangeRecordService;

    @PostMapping("/add")
    public BaseResult add(@RequestHeader(value = "belong") String belong,
                          @RequestBody DouyinLifeMemberInfoChangeAddParam param) {
        DouyinLifeMemberInfoChangeAddParamDTO addParamDTO = param.toDTO();
        addParamDTO.setBelong(belong);
        douyinLifeMemberInfoChangeRecordService.add(addParamDTO);
        return new BaseResult(0, "success", null);
    }

}